Report post

What is the difference between border and outline in CSS?

So border is computed along with the width and height of the element, while outline draws outside the element. The CSS border properties allow you to specify the style and color of an element's border. An outline is a line that is drawn around elements (outside the borders) to make the element "stand out".

What is an outline in CSS3?

In CSS3, an outline is a line that’s drawn around the outside of an element. Outlines are essentially the exact same thing as borders, they even have the same syntax in your CSS, but they differ in their placement.

Is CSS outline supported in IE7?

Sadly, CSS outline isn't supported in IE7, so i'm stuck using border. But adding a border to any element on the page takes up room and possibly shifts the page. If i'm adding a 2px border, then I set a -2px margin, it sill isn't perfect, as list items move to the left, and "margin:auto" really screws with it.

How can I use a CSS border to get the effect?

Basically, how can you use a CSS border to get the effect of a CSS outline? If it's hover effects you're worried about, and your background is of uniform colour then simply set the non-hover border ot the elements to the background colour, and then just change the colour on hover.

Related articles

The World's Leading Crypto Trading Platform

Get my welcome gifts